import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { resolve } from "path"; // 确保引入resolve

export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      "@": resolve(__dirname, "src"),
    },
  },
  server: {
    port: 8081,
    proxy: {
      "/api": {
        target: "https://www.tjyzsz.com",
        changeOrigin: true,
        rewrite: path => path.replace(/^\/api/, ""), // 去掉/api前缀
      },
    },
  },
});
